
package com.hjk.common.constants;

/**
 * 全局常量
 *
 * @author huangjunkai
 */
public interface GlobalConstant {
    /**
     * 常见字符串
     */
     interface str {
        String FILE = "file";
        String M = "M";
    }

    /**
     * 媒质字符串 后缀
     */
     interface Media {
        String JPG = "jpg";
        String GIF = "gif";
        String PNG = "png";
        String TXT = "txt";
        String MP4 = "mp4";
        String PDF = "pdf";
    }

    /**
     * The constant FILE_MAX_SIZE.
     */
     long FILE_MAX_SIZE = 5 * 1024 * 1024;
     String UNKNOWN = "unknown";

     String X_FORWARDED_FOR = "X-Forwarded-For";
     String X_REAL_IP = "X-Real-IP";
     String PROXY_CLIENT_IP = "Proxy-Client-IP";
     String WL_PROXY_CLIENT_IP = "WL-Proxy-Client-IP";
     String HTTP_CLIENT_IP = "HTTP_CLIENT_IP";
     String HTTP_X_FORWARDED_FOR = "HTTP_X_FORWARDED_FOR";


     String LOCALHOST_IP = "127.0.0.1";
     String LOCALHOST_IP_16 = "0:0:0:0:0:0:0:1";
     int MAX_IP_LENGTH = 15;

     String DEV_PROFILE = "dev";
     String TEST_PROFILE = "test";
     String PRO_PROFILE = "pro";
     int TWO_INT = 2;
     int M_SIZE = 1024;
     String ROOT_PREFIX = "hjk";

     int EXCEPTION_CAUSE_MAX_LENGTH = 2048;
     int EXCEPTION_MESSAGE_MAX_LENGTH = 2048;


     interface Number {
        int THOUSAND_INT = 1000;
        int HUNDRED_INT = 100;
        int ONE_INT = 1;
        int TWO_INT = 2;
        int THREE_INT = 3;
        int FOUR_INT = 4;
        int FIVE_INT = 5;
        int SIX_INT = 6;
        int SEVEN_INT = 7;
        int EIGHT_INT = 8;
        int NINE_INT = 9;
        int TEN_INT = 10;
        int EIGHTEEN_INT = 18;
    }



     interface Sys {


        /**
         * 全局用户名
         */
         String TOKEN_AUTH_DTO = "CURRENT_USER_DTO";

        /**
         * 超级管理员的用户ID
         */
         Long SUPER_MANAGER_USER_ID = 1L;
        /**
         * 超级管理员的用户编号
         */
         String SUPER_MANAGER_LOGIN_NAME = "admin";
        /**
         * 超级管理员角色ID
         */
         Long SUPER_MANAGER_ROLE_ID = 1L;
        /**
         * 超级管理员组织ID
         */
         Long SUPER_MANAGER_GROUP_ID = 1L;
        /**
         * 运营工作台ID
         */
         Long OPER_APPLICATION_ID = 1L;

        /**
         * The constant MENU_ROOT.
         */
         String MENU_ROOT = "root";

        /**
         * The constant DEFAULT_FILE_PATH.
         */
         String DEFAULT_FILE_PATH = "hjk/file/";

        /**
         * redis key default expire = 1MINUTES
         */
         long REDIS_DEFAULT_EXPIRE = 1L;
    }

     interface Symbol {
        String LINE = "\n";

        /**
         * The constant COMMA.
         */
        String COMMA = ",";
        String SPOT = ".";
        /**
         * The constant UNDER_LINE.
         */
        String UNDER_LINE = "_";
        /**
         * The constant PER_CENT.
         */
        String PER_CENT = "%";
        /**
         * The constant AT.
         */
        String AT = "@";
        /**
         * The constant PIPE.
         */
        String PIPE = "||";
        String SHORT_LINE = "-";
        String SPACE = " ";
        String SLASH = "/";
            String MH = ":";
        String SEM = ";";


    }

     class Oss {
        private Oss() {
        }

        /**
         * The constant DEFAULT_FILE_PATH.
         */
         String DEFAULT_FILE_PATH = "/default/";
    }


    /**
     * 图片压缩高度和宽度
     */
     int IMAGE_WIDTH = 1920;
    /**
     * The constant IMAGE_HEIGHT.
     */
     int IMAGE_HEIGHT = 1280;

    /**
     * The constant Y.
     */
     Integer Y = 1;
    /**
     * The constant N.
     */
     Integer N = 0;

    public enum PaymentTypeEnum {
        /**
         * Online pay payment type enum.
         */
        ONLINE_PAY(1, "在线支付");

        PaymentTypeEnum(int code, String value) {
            this.code = code;
            this.value = value;
        }

        private String value;
        private int code;

        /**
         * Gets value.
         *
         * @return the value
         */
        public String getValue() {
            return value;
        }

        /**
         * Gets code.
         *
         * @return the code
         */
        public int getCode() {
            return code;
        }

        /**
         * Code of payment type enum.
         *
         * @param code the code
         * @return the payment type enum
         */
        public static PaymentTypeEnum codeOf(int code) {
            for (PaymentTypeEnum paymentTypeEnum : values()) {
                if (paymentTypeEnum.getCode() == code) {
                    return paymentTypeEnum;
                }
            }
            return null;
        }

    }
}
